package com.ioday01demo;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("12.jpg");
        FileOutputStream fos = new FileOutputStream("13.jpg");
        long start = System.currentTimeMillis();//计算机当前时间
        int d =0;
        while (d != -1){
            d= fis.read();
            fos.write(d);
        }
        System.out.println("复制完毕");
        fis.close();
        fos.close();
        long end = System.currentTimeMillis();
        //程序运行时间
        System.out.println((end-start)/1000 + "秒");

    }
}
